Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prettier error-page #836

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Prettier error-page #836

wants to merge 4 commits into from

Conversation

beshrislambouli
Copy link

closes #796

Copy link
Member

@acrantel acrantel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first pr! good job :)

) : (
<span className="text-red-600 text-center block">An unknown error occurred.</span>
)}
<button
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a custom Button component in components/elements that you can use for any buttons you create, it's pre styled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just use a div here instead of a button though (put the div inside the Link component)

<span className="text-red-600 text-center block">An unknown error occurred.</span>
)}
<button
onClick={handleGoHome}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using navigate we can use the React Router Link component https://reactrouter.com/en/main/components/link

It'll simplify the logic a bit, I think that navigate should be used for more complicated logic

@acrantel
Copy link
Member

acrantel commented Nov 2, 2024

also make sure to run npm run format in the /frontend2 directory to format the files. this is needed to pass the CI:Frontend2 linting in Github

Copy link
Contributor

@lowtorola lowtorola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me other than the one idea i had for automatic error injection into the email link! Please give that a look and then re-request review 😄

<PageTitle>Oops, something went wrong.</PageTitle>
<p>
<p className="text-center">
Please reach out on Discord or to [email protected] with the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace this with whatever the standard way to link to an email address is! Maybe:

<a href="mailto:[email protected]?subject=play.battlecode.org%20Bug%20Report&body=This%20is%20the%20email%20body">[email protected]</a>

where the body is the error message and page name (or some other well-formatted embedding of the error information 😃)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error Boundary Prettification
3 participants